using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

using System.Data.Entity;
using System.Data.Common;
using System.Data.Objects;

namespace DemoApp.DataAccess 
{
  public partial class DemoAppModelDbContextInitializer 
    : DropCreateDatabaseIfModelChanges<DemoAppModelDbContext>
  {
    protected override void Seed(DemoAppModelDbContext context)
    {
      var keyedRecords = new Dictionary<string, object>();

      Role _Role;
      SecurableAction _SecurableAction;
      User _User;
      Person _Person;
      Group _Group;
      Subject _Subject;
      Favorite _Favorite;
      FavoriteDerived _FavoriteDerived;
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Create";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:Roles Create", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Delete";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:Roles Delete", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Read";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:Roles Read", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Read Name";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:Roles Read Name", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Read IsAdmin";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:Roles Read IsAdmin", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Read SecurableActions";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:Roles Read SecurableActions", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Update";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:Roles Update", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Update Name";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:Roles Update Name", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Update IsAdmin";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:Roles Update IsAdmin", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Update SecurableActions";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:Roles Update SecurableActions", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Create";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:SecurableActions Create", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Delete";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:SecurableActions Delete", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Read";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:SecurableActions Read", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Read Name";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:SecurableActions Read Name", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Read SecurableActions";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:SecurableActions Read Roles", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Update";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:SecurableActions Update", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Update Name";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:SecurableActions Update Name", _SecurableAction);
 
      _SecurableAction = new SecurableAction();
      _SecurableAction.Name = @"Role Update SecurableActions";
      context.SecurableActions.Add(_SecurableAction);
      keyedRecords.Add(@"SecurableActions:SecurableActions Update Roles", _SecurableAction);
 
      _Role = new Role();
      _Role.Name = @"Administrator";
      _Role.IsAdmin = true;
      _Role.SecurableActions.Add((SecurableAction)keyedRecords[@"SecurableActions:Roles Create"]);
      _Role.SecurableActions.Add((SecurableAction)keyedRecords[@"SecurableActions:Roles Delete"]);
      _Role.SecurableActions.Add((SecurableAction)keyedRecords[@"SecurableActions:Roles Read"]);
      _Role.SecurableActions.Add((SecurableAction)keyedRecords[@"SecurableActions:Roles Read Name"]);
      _Role.SecurableActions.Add((SecurableAction)keyedRecords[@"SecurableActions:Roles Read IsAdmin"]);
      _Role.SecurableActions.Add((SecurableAction)keyedRecords[@"SecurableActions:Roles Read SecurableActions"]);
      _Role.SecurableActions.Add((SecurableAction)keyedRecords[@"SecurableActions:Roles Update"]);
      _Role.SecurableActions.Add((SecurableAction)keyedRecords[@"SecurableActions:Roles Update Name"]);
      _Role.SecurableActions.Add((SecurableAction)keyedRecords[@"SecurableActions:Roles Update IsAdmin"]);
      _Role.SecurableActions.Add((SecurableAction)keyedRecords[@"SecurableActions:Roles Update SecurableActions"]);
      _Role.SecurableActions.Add((SecurableAction)keyedRecords[@"SecurableActions:SecurableActions Create"]);
      _Role.SecurableActions.Add((SecurableAction)keyedRecords[@"SecurableActions:SecurableActions Delete"]);
      _Role.SecurableActions.Add((SecurableAction)keyedRecords[@"SecurableActions:SecurableActions Read"]);
      _Role.SecurableActions.Add((SecurableAction)keyedRecords[@"SecurableActions:SecurableActions Read Name"]);
      _Role.SecurableActions.Add((SecurableAction)keyedRecords[@"SecurableActions:SecurableActions Update"]);
      _Role.SecurableActions.Add((SecurableAction)keyedRecords[@"SecurableActions:SecurableActions Update Name"]);
      context.Roles.Add(_Role);
      keyedRecords.Add(@"Role:Admin", _Role);
 
      _Role = new Role();
      _Role.Name = @"Member";
      _Role.IsAdmin = false;
      context.Roles.Add(_Role);
      keyedRecords.Add(@"Role:Member", _Role);
 
    }
  }
}
